<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <title>Benchmarks</title>
</head>
<body class="yui3-skin-sam">

<p><button id="start">Start Benchmarks</button></p>

<div id="log"></div>

<applet code="nano" archive="../../../vendor/benchmarkjs/nano.jar" style="display: none;"></applet>
<script src="../../../common/vendor/benchmarkjs/benchmark.js"></script>

<!--script src="http://yui.yahooapis.com/3.8.1/build/yui/yui.js"></script-->
<script src="../../../../build/yui/yui.js"></script>
<script>
var Y = YUI({
    combine: false,
    filter : 'raw',

    modules: {
        'base-benchmark': {
            fullpath: 'base-benchmark.js',
            requires: ['base']
        }
    },

    useBrowserConsole: false

}).use('base-benchmark', 'node-base', 'test-console', function (Y) {

    var suite = Y.BenchmarkSuite,
        start = Y.one('#start');

    suite.on('start', function () {
        start.set('disabled', true);
        Y.log('Starting benchmarks.', 'status', 'benchmark');
    });

    suite.on('cycle', function (e) {
        Y.log(String(e.target), 'info', 'benchmark');
    });

    suite.on('complete', function () {
        start.set('disabled', false);
        Y.log('Finished.', 'status', 'benchmark');
    });

    start.on('click', function () {
        suite.run({async: true});
    });

    new Y.Test.Console({render: '#log'}).filter.setAttrs({
        'category.fail'    : false,
        'category.status'  : true,
        'source.benchmark' : true,
        'source.TestRunner': false
    });

});
</script>

</body>
</html>
